package org.example;

import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User:何人亮
 * Date:2024-10-26
 * 15:04
 */
public class Test {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int count=0;
        while(n>0){
            int a=sc.nextInt();
            n--;
            boolean b=false;
            for(int i=2;i*i<=a;i++){
                if(a%i==0){
                    b=true;
                }
            }
            if(!b){
                count++;
            }
        }
        System.out.println(count);
    }
}
